{% load i18n fb_versions %}
<input id="{{ final_attrs.id }}" type="text" class="vFileBrowseField" name="{{ final_attrs.name }}" value="{{ value.url_save }}" /><a href="javascript:FileBrowser.show('{{ final_attrs.id }}', '{% url fb_browse %}?pop=1{% if final_attrs.directory %}&amp;dir={{ final_attrs.directory }}{% endif %}{% if final_attrs.format %}&amp;type={{ final_attrs.format }}{% endif %}');" class="fb_show"></a>
{% if value.filetype == "Image" %}
{% version_object value.path final_attrs.ADMIN_THUMBNAIL as thumbnail_version %}
{% if thumbnail_version %}
<p class="preview" id="preview_{{ final_attrs.id }}">
    <a href="{{ value.url }}" target="_blank" id="previewlink_{{ final_attrs.id }}">
        <img id="previewimage_{{ final_attrs.id }}" src="{{ thumbnail_version.url }}" class="preview" />
    </a>
</p>
{% else %}
<p class="preview" id="preview_{{ final_attrs.id }}" style="display: none;">
    <a href="javascript://" target="_self" id="previewlink_{{ final_attrs.id }}">
        <img id="previewimage_{{ final_attrs.id }}" class="preview" src="" />
    </a>
</p>
<ul class="errorlist"><li>{% trans "File not found" %}</li></ul>
{% endif %}
{% else %}
<p class="preview" id="preview_{{ final_attrs.id }}" style="display: none;">
    <a href="javascript://" target="_self" id="previewlink_{{ final_attrs.id }}">
        <img id="previewimage_{{ final_attrs.id }}" class="preview" src="" />
    </a>
</p>
{% endif %}